/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DataAccess;

import Configuracao.Autenticacao;
import de.umass.lastfm.Authenticator;
import de.umass.lastfm.Caller;
import de.umass.lastfm.Session;
import java.util.HashMap;

/**
 *
 * @author Lilli
 */
public class Authentication {
    
    private static Authentication aut;
    private static HashMap<String, String> mapa = new HashMap<String, String>();
    
    private Authentication()
    {
       mapa.put("pedrohrs08", "a@W#E$R%095895");
    }
    
    public boolean isValidAuthentication(String nome, String senha)
    {
       //return mapa.get(nome).equals(senha);
        Caller.getInstance().setUserAgent("tst");
        Caller.getInstance().setDebugMode(true);
        Session session = Authenticator.getMobileSession(nome, senha ,Autenticacao.APIkey,Autenticacao.scretKey);
        return session != null;
    }
     
    public static Authentication getInstance()
    {  if(aut == null)
           aut = new Authentication();
       return aut;
    }
    
    
   
    
}
